package com.xrj4j.utils;

import cn.dev33.satoken.secure.SaSecureUtil;

/**
 * <p> 加密工具 </p>
 */
public class AesEncryptUtils {

    private AesEncryptUtils() {
    }

    private static final String SECRET_KEY = "shiyi2022";

    /**
     * 校验内容是否一致
     */
    public static boolean validate(String target, String target1) {
        return target.equalsIgnoreCase(aesEncrypt(target1));
    }

    /**
     * AES加密
     *
     * @param password：明文密码
     * @return 密文
     */
    public static String aesEncrypt(String password) {
        return SaSecureUtil.aesEncrypt(SECRET_KEY, password);
    }
}
